<template>
  <div v-loading='pageLoading'>
    <z-table :list="list" :tableProps="tableProps" :columns="columns"> </z-table>
    <z-pagination :pagination="pagination" :total="total" :page.sync="query.page" :limit.sync="query.size"
      @change="getList"></z-pagination>
  </div>
</template>

<script>
import commonMixin from '@/views/_common/mixin'
export default {
  mixins: [commonMixin],
  name: 'tab5',
  props: {
    mo_no: {
      type: String,
      default: '',
    },
  },
  watch: {
    mo_no: {
      handler(v, o) {
        if (v) {
          this.query.queryString.mo = v
          this.getList()
        } else {
          this.list = []
          this.total = 0
        }
      },
      immediate: true,
    },
  },
  data() {
    return {
      apiList: this.$api.mokpsReport,
      query: {
        queryString: {
          mo: null,
        },
      },
      tableProps: {
        border: true,
        hideOperations: true,
      },
      columns: [
        { title: '工单号', key: 'mo_no', width: 160 },
        { title: '物料号', key: 'key_part_no', width: 160 },
        { title: '物料名称', key: 'key_part_name', width: 200 },
        { title: '机台编号', key: 'machine_code', width: 200 },
        { title: '机台名称', key: 'machine_name', width: 200 },
        { title: '供应商代码', key: 'vendor_code', width: 120 },
        { title: '供应商', key: 'vendor_name', width: 140 },
        { title: '日期码', key: 'date_code', width: 120 },
        { title: '批次', key: 'lot_sn', width: 120 },
        { title: '数量', key: 'qty', width: 70 },
        { title: '扫描条码内容', key: 'barcode', minWidth: 160 },
        { title: '操作人', key: 'create_user', width: 140 },
        { title: '操作时间', key: 'create_time', width: 140 },
      ],
    }
  },
  created() {
    this.getList()
  },
}
</script>

<style>
</style> 